import os
import uvicorn
from application import create_app,FastAPI

app:FastAPI=create_app()

@app.get('/api')
async def api() -> dict:
    """测试接口"""
    return {'title':'fastchat'}

if __name__ == '__main__':
    uvicorn.run('main:app',host=os.environ.get('APP_HOST','0.0.0.0'),
                port=int(os.environ.get('APP_PORT',8000)),
                reload=bool(os.environ.get('DEBUG',True)))
